const Koa = require('koa');
const app = new Koa();

//解析post请求
const BodyParser = require('koa-bodyparser');
//引入登录理由
const login = require('./route/user')
//引入列表理由
const list = require('./route/list')
//解决跨域问题
const cors = require('koa2-cors');


app.use(cors());
app.use(BodyParser());
//登录路由
app.use(login.routes(), login.allowedMethods())
//列表路由
app.use(list.routes(), list.allowedMethods())
const PORT = 8000;
app.listen(PORT, () => {
  console.log(`8000端口启动成功`);
});